package com.colorlight.cloud.gateway.api.message.api;

import com.colorlight.cloud.gateway.api.message.constraint.schedule.ScheduleActions;
import com.colorlight.cloud.gateway.api.message.model.Msg;
import com.colorlight.cloud.xm.api.XmProcessMessageEventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static com.colorlight.cloud.common.constants.CommonConstants.GSON;

/**
 * @author Demon
 * @date 20/1/2024  下午3:42
 */
public interface XmDefaultProcess<K extends ScheduleActions> extends XmProcessMessageEventHandler<K> {
	Logger log = LoggerFactory.getLogger(XmDefaultProcess.class);
	
	@Override
	default void accept(String deviceName, Msg<K> msg) {
		log.info("设备DeviceName:{}\n 屏体Uid:{}\n 消息类型：{} \n 消息：{} ", deviceName, msg.getUuid(),msg.getBizContent().getClass().getName(), GSON.toJson(msg));
	}
	
}
